package com.icez.base_compose_framework.ui.home

import androidx.lifecycle.ViewModel
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import javax.inject.Inject

@HiltViewModel
class HomeScreenViewModel @Inject constructor():ViewModel() {
    private val _state = MutableStateFlow<HomeScreenState>(HomeScreenState.Loading)
    val state:StateFlow<HomeScreenState>
        get() = _state
}

sealed interface HomeScreenState {
    data object Loading:HomeScreenState

    data class Error(val errorMessage:String ?= null):HomeScreenState

    data class Ready(
        val data:String ?= null
    ):HomeScreenState
}